<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.util.Vector,com.ejoysoft.wlanyz.business.Task,com.ejoysoft.wlanyz.business.Ap,com.ejoysoft.common.Constants,com.ejoysoft.common.exception.IdObjectException,com.ejoysoft.common.exception.NoRightException" %>
<%@page import="com.ejoysoft.common.Format"%>
<%@page import="javax.crypto.Mac"%>
<%@ include file="../include/jsp/head.jsp"%>

<%
try{
	String strTaskId = ParamUtil.getString(request,"strTaskId","");
	if(strTaskId.equals(""))
    	throw new IdObjectException("请求处理的信息id为空！或者已经不存在");
    String where="where strTaskId='"+strTaskId+"'";
    Task obj=new Task(globa,false);
    Task obj1=obj.show(where);
    int intState = obj1.getIntIssued();
    if(intState==1)
    {
    out.print("<script>alert('此任务已下发Ap！');window.history.back(-1);</script>");
    }
    String hotpot =obj1.getStrHotpotName();
    Ap obj2=new Ap(globa,false);
    String tWhere=" where strHotSpot='"+hotpot+"'"; 
	//记录总数
	int intAllCount=obj2.getCount(tWhere);
	//当前页
	int intCurPage=globa.getIntCurPage();
	//每页记录数
	String strPageSize = ParamUtil.getString(request,"strPageSize","10");
    int intPageSize;
    if(strPageSize.equals("所有"))intPageSize = intAllCount;
      else  intPageSize = Integer.parseInt(strPageSize);
	//共有页数
 	int intPageCount=(intAllCount-1)/intPageSize+1;
	// 循环显示一页内的记录 开始序号
	int intStartNum=(intCurPage-1)*intPageSize+1;
	//结束序号
	int intEndNum=intCurPage*intPageSize;   
	//获取到当前页面的记录集
	Vector<Ap> vctObj=obj2.list(tWhere,intStartNum,intPageSize);
	//获取当前页的记录条数
	int intVct=(vctObj!=null&&vctObj.size()>0?vctObj.size():0);
    
    
%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=application.getAttribute("APP_TITLE")%></title> 
<link href="../css/main.css" rel="stylesheet" type="text/css" /></link>
<script language="JavaScript" src="../include/date/popc.js"></script>
<script src="../include/js/list.js"></script>
<script language="javascript">
 function chkFrm() {          
  	frm.submit();         
    }

</script>
<style type="text/css">
</style>
</head>


<body>
<form name="frm" method=post action="task_act.jsp"  >

<input type="hidden" name="<%=Constants.ACTION_TYPE%>" value="<%=Constants.ADD_STR1%>"></input>
<input type="hidden" name=strTaskId value="<%=strTaskId%>"></input>

<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><img src="../images/ri_list.jpg" width="14" height="14" align="absbottom" />&nbsp;您现在所在的位置：<font color="#0e7cc9">任务管理</font> &gt; 手动下发Ap</td>
  </tr>
</table>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="8"></td>
        </tr><tr>
    <td height="25" valign="middle"><strong>&nbsp;AP详细信息</strong></td>
  </tr>
</table>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>
    <td width="10%" class="listtit"  style="border-left:1px solid #32a4ea;"><input type="checkbox" name="checkbox62" value="checkbox" onclick="selAll(document.all.device_Id)" style="height:12px;" /> 选择</td>
    <td width="16%" class="listtit" style="border-left:1px solid #32a4ea;" >Mac地址</td>
    <td width="18%" class="listtit">设备名</td>
    <td width="16%" class="listtit">所属热点</td>
    <td width="16%" class="listtit">覆盖类型</td>
    <td width="16%" class="listtit">IP地址</td>    
    
  </tr>
    <%
      
     for (int i = 0; i < vctObj.size(); i++) {
    		String device_Id = "";
    		String device_Name = "";
    		String redian = "";
    		String fgType = "";
    		String ip = "";
    		String mac = "";
    		Ap obj3 = vctObj.get(i);
    		if (obj3.getDevice_Id() != null)
    			device_Id = obj3.getDevice_Id();
    		if (obj3.getDevice_Name() != null)
    			device_Name = obj3.getDevice_Name();
    		if (obj3.getStrHotSpot() != null)
    			redian = obj3.getStrHotSpot();
    		if (obj3.getStrCoverage_Type() != null)
    			fgType = obj3.getStrCoverage_Type();
    		if (obj3.getStrIp_Addr() != null)
    			ip = obj3.getStrIp_Addr();
    		if (obj3.getStrMac_Addr() != null)
    			mac = obj3.getStrMac_Addr();
    			
    %>

  <tr>
  	<td class="listd1" style="border-left:1px solid #dddddd;"><input type="checkbox"  name=device_Id  id=device_Id value="<%=obj3.getDevice_Id()%>" style="height:12px;" /></td>
    <td class="listd1" style="border-left:1px solid #dddddd;"><%=mac%>&nbsp;</td>
    <td class="listd1"><%=device_Name%>&nbsp;</td>
    <td class="listd1"><%=Format.forbidNull(obj3.getStrHotSpotName())%>&nbsp;</td>
    <td class="listd1"><%=fgType%>&nbsp;</td>
    <td class="listd1"><%=ip%>&nbsp;</td>

     </tr>
             <%
             	}
             
             %>
</table>





<table width="97%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="61%" height="50" valign="bottom"><!--<img src="../images/pldel.jpg" width="83" height="27" align="middle" />--> &nbsp;&nbsp;页面记录数
      <select name="strPageSize" id="strPageSize" style="width:52px;" onchange="showAc()">
		<% 
		 String sltOpt[] = {"10","20","30","50","70","100","所有"};
		 for(int i=0; i < sltOpt.length;i++){
		 	String selected = "";
		    if(sltOpt[i].equals(strPageSize))
		      selected="selected='selected'";
		 %>
		 <option value="<%=sltOpt[i] %>" <%=selected %>><%=sltOpt[i] %></option>
   		<%
   		 }
   		 %>
   		 </select>
      </td>
      
    
      <td width="39%" align="right" valign="bottom"><!--<table width="310" border="0" cellspacing="0" cellpadding="0">
       <tr>
        <td width="40"><img src="../images/up.jpg" width="40" height="30" /></td>
        <td width="221" align="center" background="../images/page_bg.jpg" class="page"><a href="#">1</a>&nbsp; <a href="#">2</a>&nbsp; <a href="#">3</a>&nbsp; <a href="#"><span class="sel">4</span></a>&nbsp; <a href="#">5</a> &nbsp;<a href="#">6</a> &nbsp;<a href="#">7</a>&nbsp; <a href="#">8 </a>&nbsp;<a href="#">9</a>&nbsp;...&nbsp;<a href="#">13</a> </td>
        <td width="39"><img src="../images/down.jpg" width="39" height="30" /></td>
       </tr>
    </table>
  -->
  <!-- 翻页开始 -->  
     	<%@ include file="../include/jsp/cpage.jsp"%>
       	<!-- 翻页结束 --> </td>
  </tr>
</table>
<table width="832" border="0" cellspacing="0" cellpadding="0" height="35">
              <tr>
               <td width="3%" >&nbsp; <br></td>
              <td width="40%" height="20" align="right"> <input name="B1" type="button"   value="确  定" onclick="chkFrm()"  class="ipt2" /></td>
               <td width="3%" >&nbsp; <br></td>
               <td width="32%" height="20"><input  name="B12" type="reset"  value="取 消" class="ipt2" /></td>
               <td height="30" class="left_txt2">&nbsp;</td>               
            </tr> 
            </table>




 </form>
</body>
</html>
<%     	}catch (Exception e) {
            e.printStackTrace();        
        } %>
<%@ include file="../include/jsp/footer.jsp"%>


